package com.itcast.n9_垃圾回收;

import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

/**
 * @program: jvm
 * @description:
 * @author: flyduck
 * @create: 2024-10-08 11:44
 **/
//-Xms60m -Xmn20m -Xmx60m -XX:SurvivorRatio=3   -XX:+PrintGCDetails
//[Full GC (Ergonomics) [PSYoungGen: 4008K->0K(16384K)] [ParOldGen: 27688K->31492K(40960K)]
//gc.ps_scavenge   gc.ps_marksweep(其实是标记整理算法，历史原因)
public class Test20_垃圾回收器_默认使用ParallelScavenge和ParallelOld垃圾回收器 {
    public static void main(String[] args) throws IOException {
        List<Object> list = new ArrayList<>();
        int count = 0;
        while (true){
            System.in.read();
            System.out.println(++count);
            //每次添加1m的数据
            list.add(new byte[1024 * 1024 * 1]);
        }
    }
}
